package org.jmc.refmanager.web.wicket.page.panel;

import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.panel.Panel;

/**
 */
public abstract class ConfirmDeletePanel extends Panel {
	private static final long serialVersionUID = 1L;
	
	protected abstract void onConfirm();
	
	public ConfirmDeletePanel(String id, String message) {
		super(id);
		 
	    add(new Label("message", message));
	    add(new Link<Void>("btnConfirm") {
			private static final long serialVersionUID = 1L;

		@Override
	      public void onClick() {
	        onConfirm();
	      }
	    });
	    add(new Link<Void>("btnCancel") {
			private static final long serialVersionUID = 1L;

		@Override
	      public void onClick() {
	        onCancel();
	      }
	    });
	  }
	
	/**
	 * Comportement par defaut
	 */
	protected void onCancel() {
	};
}

